package other;

import java.util.Random;
import java.util.Vector;

class myThreadClass extends java.lang.Thread {
	   volatile static boolean Stop = false;

	   // Primordial thread executes main()
	   public static void main(String args[]) throws InterruptedException {

		   Random generator = new Random();
		   Vector<Integer> arr = new Vector<Integer>();
		   for(int i=0;i<10;i++) {
			   arr.add(i, 0);
		   }
		   for(int i=0;i<10000000;i++) {
			   int j=generator.nextInt(10);
			   Integer k=arr.elementAt(j);
			   arr.set(j, k+1);
		   }
		   int k=0;
		   for(int i=0;i<10;i++) {
			   k=k+arr.elementAt(i);
			   System.out.println(arr.elementAt(i));
		   }
		   System.out.println(k);
	   }
	}
